// valac --pkg dbus-glib-1 -o notify-vala notify-vala.vala

/* DBus Vala Sample Code */
using GLib;
using DBus;

[DBusInterface (name = "org.freedesktop.Notifications")]
interface Notifications;

static int main (string[] args) {
    DBus.Connection conn;
    Notifications notific;
    MainLoop loop = new MainLoop (null, false);

    conn = DBus.Bus.get (DBus.BusType.SESSION);
    notific = conn.get_object<Notifications> ("org.freedesktop.Notifications",
                                              "/org/freedesktop/Notifications");

    try {
        notific.Notify("notify-vala", 0,
                       "/usr/share/icons/Tango/scalable/devices/harddrive.svg",
                       "Harddisk em Chamas!",
                       "Parece que seu hardisk queimou de vez...",
                       null, null, 4000);
  /*if (!dbus_g_proxy_call (proxy, "Notify", &error,
                          G_TYPE_STRING, "dbus_notify.c",
                          G_TYPE_UINT, 0,
                          G_TYPE_STRING, "/usr/share/icons/Tango/scalable/devices/harddrive.svg",
                          G_TYPE_STRING, "Harddisk em Chamas!",
                          G_TYPE_STRING, "Parece que seu hardisk queimou de vez...",
                          G_TYPE_STRV, NULL,
                          dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), NULL,
                          G_TYPE_INT, 4000,
                          G_TYPE_INVALID,
                          G_TYPE_UINT, &ret_id,
                          G_TYPE_INVALID))*/

    } catch (DBus.Error dbus_error) {
        critical (dbus_error.message);

    }

    loop.run ();

    return 0;
}

